<template>
  <div>
    <x-header title="TestPage"></x-header>
    <search v-model="params.keyWord" @on-submit="onSearch"></search>
    <x-table>
      <page :url="url" method="post" :param="params" pageNumKey="curPageNum" :callback="callback" ref="pageDataList">
        <template slot-scope="{datas}">
          <tr v-for="_new in datas">
            <td style="text-align: left;">{{ _new.TITLE }}</td>
          </tr>
        </template>
      </page>
    </x-table>
  </div>
</template>

<script>
  import {XHeader, Search, XTable} from 'vux'
  import * as config from '../config/index'
  import Page from './common/Page'

  export default {
    name:'TestPage',    // 必须要改成你自己模块的名称，回退页面的时候会用到
    components: {
      XHeader,
      Search,
      XTable,
      Page
    },
    data(){
      return {
        url: config.rootpath + '/app/news/eCardNews',
        params:{
          pageCount: 10,
          keyWord : ''
        }
      }
    },
    methods: {
      onSearch () {
        this.$refs.pageDataList.refresh()
      },
      callback (data) {
        console.log(data)
      }
    }
  }
</script>
<style scoped>

</style>
